/*******************************************************************
 * 
 *  Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
 *
 *  Description: 
 *
 *  Author: Amlogic Software
 *  Created: Fri Nov 11 01:14:07 2005
 *
 *******************************************************************/
#include <stdio.h>  
#include <string.h>   

#include <includes.h>
#include <aw_windows.h>
#include <amsysdef.h>
#include "user.h"
#include "ioapi.h"
#include "os/ioapi/libblock/include/ramdisk.h"
#include "sys_app.h"
#include <policy.h>
#include <filesystem/extend/fileio.h>
//#include <avnet.h>
#include "gui/aw_init_display.h"

#include "aw_device.h"
#include <bsp.h>

extern void OSIrqISR(void); 
extern void OSFiqISR(void); 

SYSTEMINFO gSystemInfo ; 

#if 1 

void HardwareReset(void* arg){


//    printf("Hardware Reset Hook\n");
//    CLEAR_VD4_GPIO_LOW;
//    AVTimeDly(300);
//    SET_VD4_GPIO_HIGH;
//    GPIO_UNMUTE;     /* unmute */
//    AVTimeDly(1500);
}
#endif //endif 0



int main(void)
{ 
#if OS_TASK_DEBUGHELPER_EN>0
 //   AVOS_Print_Flag |= DBGHLP_LOG_APPCMD|DBGHLP_PRINT_USB|DBGHLP_LOG_FILENAV;
//	AVOS_Print_Flag |= DBGHLP_LOG_APPCMD|DBGHLP_PRINT_USB|DBGHLP_LOG_FAT_MORE|DBGHLP_LOG_FAT|DBGHLP_LOG_FILEOP|DBGHLP_LOG_FILENAV|DBGHLP_LOG_FILEOP_MORE;
#endif
	GPIO_MB_MUTE
	memset((char *)DEFAULT_AUDIO_OUTPUT[0].start, 0, DEFAULT_AUDIO_OUTPUT[0].end - DEFAULT_AUDIO_OUTPUT[0].start);					
	    /* kernal OS init */
    AVInit();                                             

    /* memory library init */
	AVMemInit();
	
#ifdef ENABLE_NETWORK

#ifdef HAS_USB_NET_ZD1211B
  pbuf_set_pack_pbufs_config(0, 2464);
#endif /* HAS_USB_NET_ZD1211B */
#ifdef HAS_USB_NET_AX88772
    /* AX88772 driver will need larger pbuf packet size. */
    pbuf_set_pack_pbufs_config(0, 2048);
#endif 
    /* Launch core processes */
    ipcore_init();
#endif

    /* Create GUI App task and start */    
    AWWinMainStart() ;
    
    AVDebugHelperInit();
    
    AVStart();

    return 0;
}




